<template>
  <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
    <van-swipe-item v-for="item in SwipeList" :key="item.imgSrc">
      <img :src="item.imgSrc" />
    </van-swipe-item>
  </van-swipe>
</template>
<script setup lang="ts">
import axios from 'axios'
import { Swipe as vanSwipe, SwipeItem as vanSwipeItem } from 'vant'
import { ref, onMounted } from 'vue'



// 轮播图
interface ISwipeItem {
  link: string,
  imgSrc: string
}
const SwipeList = ref<ISwipeItem[]>([])
onMounted(async () => {
  const res = await axios({
    method: "get",
    url: "/swiperList",
  })
  SwipeList.value = res.data.result
})





</script>
<style scoped lang="scss">
.my-swipe {

  margin: 5px;
  border-radius: 5px;



  .van-swipe-item {
    img {
      width: 100%;
    }
  }



}
</style>